import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DeviceDailyComponent } from './device-daily.component';
import { HandheldMachineComponent } from './handheld-machine/handheld-machine.component';
import { ElectronicLockComponent } from './electronic-lock/electronic-lock.component';
import { FixReaderComponent } from './fix-reader/fix-reader.component';
import { AppRouteGuard } from '@shared/common/auth/auth-route-app-guard';

const routes: Routes = [

  {
    path: '',
    canActivate: [AppRouteGuard],
    canActivateChild: [AppRouteGuard],
    component: DeviceDailyComponent,
    data: { breadcrumb_no_url: 'device_normal_manage' },
    children: [
      {
        path: 'handheldMachine',
        component: HandheldMachineComponent,
        data: { permission: 'A7_B19_', activeMenu: 'handheldMachine', tabBelong: 'daily', breadcrumb: 'pda_manage' }
      },
      {
        path: 'electronicLock',
        component: ElectronicLockComponent,
        data: { permission: 'A7_B20_', activeMenu: 'electronicLock', tabBelong: 'daily', breadcrumb: 'lockset_manage' }
      },
      {
        path: 'fixReader',
        component: FixReaderComponent,
        data: { permission: 'A7_B21_', activeMenu: 'fixReader', tabBelong: 'daily', breadcrumb: 'fixed_device_manage' }
      },
    ],
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class DeviceDailyRoutingModule { }
